<template>
	<view>
		<!-- <image src="../../static/equity_img.png" style="width: 750rpx;height: 750rpx;" class="bg"></image> -->
		<view class="container">
			<view class="title">
				<u-icon name="arrow-left" @click="back" size="24" color="white"></u-icon>
				<view>
					{{title}}
				</view>
				 <u-icon name="reload" @click="reload"  size="24" color="white"></u-icon>
			</view>
			<view style="margin-top: 370rpx;">
				<view v-for="(v,i) in list" :key="" class="item">
					<view class="flex">
						<view>原因：{{v.title}}</view>
						<view style="color:grey;font-size: 12px;">{{v.createTime}}</view>
					</view>
					<view class="flex" style="margin-top: 40rpx;">
						<view>余额:{{v.balance}}</view>
						<view class="flex" style="font-size: 40rpx;">
								<view v-if="v.type" :style="{color:color}">+</view>
								<view v-else style="color:green">-</view>
							<view :style="{color :v.type == 1 ? color:'green'}">{{v.target}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	let app = getApp();
	export default{
		onLoad(option){
			this.title = option.type == 0 ? '佣金明细':'积分明细';
			this.type = option.type;
			this.getList();
			
		},
		onReachBottom() {
			this.pNumber++;
			this.getList();
		},
		data(){
			return{
				color: app.globalData.defaultColor,
				title:'佣金明细',
				type:0, //0是佣金 1是积分
				pSize:20,
				pNumber:1,
				list:[
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':0,'balance':10086.32,'target':100.00},
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':1,'balance':10086.32,'target':100.00},
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':0,'balance':10086.32,'target':100.00},
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':0,'balance':10086.32,'target':100.00},
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':0,'balance':10086.32,'target':100.00},
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':0,'balance':10086.32,'target':100.00},
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':0,'balance':10086.32,'target':100.00},
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':0,'balance':10086.32,'target':100.00},
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':0,'balance':10086.32,'target':100.00},
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':0,'balance':10086.32,'target':100.00},
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':0,'balance':10086.32,'target':100.00},
					{'createTime':'2024-12-23 12:32:00','title':'提现扣除','type':0,'balance':10086.32,'target':100.00}
				],
			}
		},
		methods:{
			back(){
				uni.switchTab({
					url:'/pages/mine/index'
				})
			},
			reload(){
				this.pNumber = 1;
				this.getList()
			},
			getList(){
				let url = ''
				if(this.type == 1){
					
				}else {
					
				}
				uni.$u.http.get(url,{'pSize':this.pSize,'pNumber':this.pNumber}).then(res => {
				  
				})
			}
		}
		
	}
</script>

<style lang="scss" scoped>
	.bg{
		position: absolute;
		z-index:1;
	}
	.container{
		position: absolute;
		z-index: 1000;
		left:20rpx;
		width:710rpx;
	}
	.title{
		display: flex;
		justify-content: space-between;
		align-items: center;
		width:100%;
		color:white;
		font-size: 30rpx;
		padding-top:50rpx;
	}
	.item{
		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
        background-color: white;
		padding:20rpx;
		min-height: 100rpx;
		border-radius: 10rpx;
		margin-bottom: 20rpx;
	}
	.flex{
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
</style>
